package com.lk.api.own;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;
import android.widget.Toast;

public class LocalService extends Service {
	static final String TAG = "LocalService";

	// �ӿڶ���
	IBinder iBinder = new LocalBinder();

	// ����IBinder�ӿ�ʵ��
	public class LocalBinder extends Binder {

		// ����������
		public LocalService getLocalService() {
			Log.d(TAG, "getLocalService");
			return LocalService.this;
		}

	}

	@Override
	public IBinder onBind(Intent intent) {
		// TODO Auto-generated method stub
		Log.d(TAG, "onBind");
		return iBinder;
	}

	public void sayHelloWorld() {
		Log.d(TAG, "sayHelloWorld");
		Toast.makeText(LocalService.this, "Hi Local Binder Service!",
				Toast.LENGTH_SHORT).show();
	}
	@Override
	public void onDestroy() {
		// TODO Auto-generated method stub
		Log.d(TAG, "onDestroy");
		super.onDestroy();
	}

}
